// import Parent from "../Parent";

import { SchemaNodeKey } from "@/utils/constants";
import productImg from "@/assets/images/login/3.png";
import { ComponentInternalInstance, getCurrentInstance } from "vue";

/**
 * 简单、相对固定的基础信息：scheme中的basic部分字段，
 */
//根据Schema绘制基本信息
export default defineComponent({
	props: {
		visible: {
			type: Boolean,
			default() {
				return false;
			}
		}
	},
	emits: [],
	setup() {
		const { proxy } = getCurrentInstance() as ComponentInternalInstance;
		// const profile = inject<any>(SchemaNodeKey.profile);
		const detailInfo = inject<any>(SchemaNodeKey.detailInfo);
		return () => {
			return (
				<div class="block-simple pt-4 pb-4 relative">
					<div class="grid grid-cols-3">
						<div class="flex item">
							<div class="info-title text-right w-1/3">{proxy?.$t("product_simpleinfo.dialog_title.name")}</div>
							<div class="info-text flex-1">{detailInfo.detail.name || "--"}</div>
						</div>
						<div class="flex item">
							<div class="info-title text-right w-1/3">{proxy?.$t("product_simpleinfo.dialog_title.model")}</div>
							<div class="info-text flex-1"> {detailInfo.detail.model || "--"} </div>
						</div>
						<div class="flex item">
							<div class="info-title text-right w-1/3">{proxy?.$t("product_simpleinfo.dialog_title.description")}</div>
							<div class="info-text flex-1"> {detailInfo.detail.description || "--"} </div>
						</div>
					</div>
					<div class="absolute" style=" opacity: 0.4;right: 27px;top: -8px;width: 119px;height: 94px;">
						<img src={productImg} class="w-full h-full" />
					</div>
				</div>
			);
		};
	}
});
